<!doctype html>

<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="<%=page.language%>"> <![endif]-->
<!--[if IE 7]>    <html class="no-js lt-ie9 lt-ie8" lang="<%=page.language%>"> <![endif]-->
<!--[if IE 8]>    <html class="no-js lt-ie9" lang="<%=page.language%>"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js" lang="<%=page.language%>">
<!--<![endif]-->

<% include ./cms/header.ejs %>

<!-- TODO translation.... where?
<h2 id="loginfirst">Alvorens naar de gevraagde pagina te gaan, moet U zich eerst aanmelden.</h2>
<p class="warning">Verkeerde gebruikersnaam of wachtwoord, gelieve nogmaals te proberen.</p>
<p class="warning">Uw gebruikersnaam is geblokkeerd, gelieve contact op te nemen met de site bouwer.</p>
<p class="warning">U bent nu afgemeld</p>
-->


<body class="intro-header">
    <header>
        <% include ./cms/top.ejs %>
        <% include ./cms/navigation.ejs %>
    </header>

    <!-- container -->
    <div class="container">
        <div class="row">
            <!-- Article main content -->
            <article class="col-xs-12">
                <% if (isLoggedIn()) { %>
                    <div class="col-md-6 col-md-offset-3 col-sm-8 col-sm-offset-2">
                        <div class="panel panel-default">
                            <div class="panel-body">
                                <h3 class="text-center"><%= __("Now user:")%><%=session.login.name%></h3>
                                <hr>
                                <form>
                                    <hr>
                                    <div class="row">
                                        <div class="col-lg-8">
                                            <b><a href="/<%=page.language%>/users?request=edit&id=<%=login.id%>"><%= __("Account")%></a></b>
                                        </div>
                                        <div class="col-lg-4 text-right">
                                            <button class="btn btn-action" onclick="javascript:window.location.href='login?request=logout';"><%= __("Logout")%></button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                <% } else { %>
                    <div class="col-md-6 col-md-offset-3 col-sm-8 col-sm-offset-2">
                        <div class="panel panel-default">
                            <div class="panel-body">
                                <h3 class="text-center" id="loginfirst"><%= __("Before you can access this requested page you first need to login.")%></h3>
                                <hr>
                                <form action="/<%=page.language%>/login" name="logon" id="logon" method="post" class="clearfix">
                                    <input type="hidden" name="request" value="login" />
                                    <div class="top-margin" id="logonuser">
                                        <label for="username"><%= __("Username")%>: <span class="text-danger">*</span></label>
                                        <input name="username" id="username" type="text" class="form-control" />
                                    </div>
                                    <div class="top-margin">
                                        <label for="password"><%= __("Password")%>: <span class="text-danger">*</span></label>
                                        <input type="password" class="form-control" id="password" name="password" />
                                    </div>

                                    <% if (message == "login-failed") { %>
                                        <p class="warning"><%= __("Wrong username of password, please try again.")%> </p>
                                    <% } else if (message == "login-locked") { %>
                                        <p class="warning"><%= __("Your username is blocked, please take contact with your site builder.")%> </p>
                                    <% } %>

                                    <hr>
                                    <div class="row">
                                        <div class="col-lg-8">
                                            <b><a href=""><%= __("Forgot password")%>?</a></b>
                                        </div>
                                        <div class="col-lg-4 text-right">
                                            <button class="btn btn-action" type="submit"><%= __("Log on")%></button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                <% } %>

                <% if (message == "logout") { %>
                    <p class="warning">You've been logged out.</p>
                <% } %>
            </article>
        </div>
    </div>

    <script type="text/javascript" language="JavaScript">
        document.forms['logon'].elements['username'].focus();
    </script>

</body>
</html>
